package cz.muni.fi.pa165.springapplication.dao;
import cz.muni.fi.pa165.springapplication.dao.CustomerManager;
import cz.muni.fi.pa165.springapplication.entities.Customer;
import cz.muni.fi.pa165.springapplication.exceptions.IllegalOrphanException;
import cz.muni.fi.pa165.springapplication.exceptions.PreexistingEntityException;
import cz.muni.fi.pa165.springapplication.exceptions.NonexistentEntityException;
import java.util.List;


public interface CustomerManager {
    
    /**
     * Creates new Customer in database and sets its ID
     * 
     * @param customer Customer object to be created
     * @throws IllegalOrphanException when customer id is already set
     * @throws IllegalArgumentException when customer is null
     */
    public void createCustomer(Customer customer) throws IllegalOrphanException, PreexistingEntityException;
    
    /**
     * Updates existing Customer in database
     * 
     * @param customer Customer object to be updated
     * @throws IllegalArgumentException when customer == null or some of the not-optional arguments of Customer is missing
     * @throws IllegalOrphanException when customer id == null
     * @throws NonexistentEntityException when Customer with set id doesn't exist in database
     */
    public void updateCustomer(Customer customer) throws NonexistentEntityException, IllegalOrphanException, PreexistingEntityException, Exception;
    
    /**
     * Deletes Customer from database
     * 
     * @param customer 
     * @throws IllegalArgumentException when customer == null
     * @throws IllegalOrphanException when customer id == null
     * @throws NonexistentEntityException when Customer with set id doesn't exist in database
     */
    public void deleteCustomer(Customer customer) throws NonexistentEntityException, IllegalOrphanException;
    
   
    public Customer getCustomerById(Long id);
}